<!DOCTYPE html>
<html lang="{{ .Site.Language }}" itemscope itemtype="https://schema.org/WebPage">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="theme-color" content="#466BB0"/>

        {{ with .Page.Description }}
            {{ if not (or (strings.HasSuffix . ".") (strings.HasSuffix . "。")) }}
                {{ errorf "Page description doesn't end with a period: '%s'" . }}
            {{ end }}
        {{ end }}

        {{ define "description" }}{{ with .Page.Description }}{{ . }}{{ else }}Connect, secure, control, and observe services.{{ end }}{{ end }}

        <meta name="title" content="{{ .Title }}">
        <meta name="description" content="{{ template "description" . }}">

        {{ if .Page.Params.attribution }}
            <meta name="author" content="{{ .Page.Params.attribution }}">
        {{ end }}

        {{ if .Page.Params.keywords }}
            <meta name="keywords" content="microservices,services,mesh,{{ delimit .Page.Params.keywords "," }}">
        {{ else }}
            <meta name="keywords" content="microservices,services,mesh">
        {{ end }}

        <!-- Open Graph protocol -->
        <meta property="og:title" content="{{ .Title }}">
        <meta property="og:type" content="website">
        <meta property="og:description" content="{{ template "description" . }}">
        {{ if .Permalink }}
            <meta property="og:url" content="{{ .Permalink }}">
        {{ end }}
        <meta property="og:image" content="{{ .Site.BaseURL }}/img/istio-whitelogo-bluebackground-framed.svg">
        <meta property="og:image:alt" content="Istio Logo">
        <meta property="og:image:width" content="112">
        <meta property="og:image:height" content="150">
        <meta property="og:site_name" content="Istio">

        <!-- Twitter card -->
        <meta name="twitter:card" content="summary">
        <meta name="twitter:site" content="@IstioMesh">
        {{ if .Page.Params.twitter }}
            <meta name="twitter:creator" content="@{{ .Page.Params.twitter }}">
        {{ end }}

        {{ $analytics_id := .Site.Data.args.main_analytics_id }}
        {{ if .Site.Data.args.archive_landing }}
            <title>istio.io Archives</title>
        {{ else if .Site.Data.args.archive }}
            {{ if eq .Title "Istio" }}
                <title>Istioldie {{ .Site.Data.args.version }}</title>
            {{ else }}
                <title>Istioldie {{ .Site.Data.args.version }} / {{ .Title }}</title>
            {{ end }}
            {{ $analytics_id = .Site.Data.args.archive_analytics_id }}
        {{ else if .Site.Data.args.preliminary }}
            {{ if eq .Title "Istio" }}
                <title>Istio Prelim {{ .Site.Data.args.version }}</title>
            {{ else }}
                <title>Istio Prelim {{ .Site.Data.args.version }} / {{ .Title }}</title>
            {{ end }}
            {{ $analytics_id = .Site.Data.args.preliminary_analytics_id }}
        {{ else }}
            {{ if eq .Title "Istio" }}
                <title>Istio</title>
            {{ else }}
                <title>Istio / {{ .Title }}</title>
            {{ end }}
        {{ end }}

        <!-- Google Analytics -->
        <script async src="https://www.googletagmanager.com/gtag/js?id={{ $analytics_id }}"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', '{{ $analytics_id }}');
        </script>
        <!-- End Google Analytics -->

        <!-- RSS -->
        <link rel="alternate" type="application/rss+xml" title="Istio Blog" href="/blog/feed.xml">
        <link rel="alternate" type="application/rss+xml" title="Istio News" href="/news/feed.xml">
        <link rel="alternate" type="application/rss+xml" title="Istio Blog and News" href="/feed.xml">

        <!-- Favicons: generated from img/istio-whitelogo-bluebackground-framed.svg by http://cthedot.de/icongen -->
        <link rel="shortcut icon" href="/favicons/favicon.ico" >
        <link rel="apple-touch-icon" href="/favicons/apple-touch-icon-180x180.png" sizes="180x180">
        <link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
        <link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
        <link rel="icon" type="image/png" href="/favicons/android-36x36.png" sizes="36x36">
        <link rel="icon" type="image/png" href="/favicons/android-48x48.png" sizes="48x48">
        <link rel="icon" type="image/png" href="/favicons/android-72x72.png" sizes="72x72">
        <link rel="icon" type="image/png" href="/favicons/android-96x96.png" sizes="96xW96">
        <link rel="icon" type="image/png" href="/favicons/android-144x144.png" sizes="144x144">
        <link rel="icon" type="image/png" href="/favicons/android-192x192.png" sizes="192x192">

        <!-- app manifests -->
        <link rel="manifest" href="/manifest.json">
        <meta name="apple-mobile-web-app-title" content="Istio">
        <meta name="application-name" content="Istio">

        <!-- style sheets -->
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Work+Sans:400|Chivo:400|Work+Sans:500,300,600,300italic,400italic,500italic,600italic|Chivo:500,300,600,300italic,400italic,500italic,600italic">
        <link rel="stylesheet" href="/css/all.css">

        <!-- set the color theme -->
        <script src="/js/themes_init.min.js"></script>
    </head>

    {{ $site_mode := ""}}
    {{ if or .Site.Data.args.archive .Site.Data.args.archive_landing }}
        {{ $site_mode = "archive-site" }}
    {{ else if .Site.Data.args.preliminary }}
        {{ $site_mode = "preliminary-site" }}
    {{ end }}

    <body class="language-unknown {{ $site_mode}}">
        <!-- inject some build-time constants into JavaScript-land -->
        <script>
            const branchName = "{{ .Site.Data.args.source_branch_name }}";
            const docTitle = "{{ .Title }}";
            const iconFile = "{{ .Site.BaseURL}}/img/icons.svg";
            const buttonCopy = '{{ i18n "button_copy" }}';
            const buttonPrint = '{{ i18n "button_print" }}';
            const buttonDownload = '{{ i18n "button_download" }}';
        </script>

        <!-- libraries we unconditionally pull in -->
        <script src="https://www.google.com/cse/brand?form=search-form" defer></script>

        <!-- our own stuff -->
        <script src="/js/all.min.js" data-manual defer></script>

        {{ partial "events.html" (dict "page" . "kind" "sticker") }}
        {{ partial "header.html" . }}
        {{ partial "events.html" (dict "page" . "kind" "banner") }}

        {{ block "main" . }}{{ end }}
        {{ partial "footer.html" . }}

        <!-- libraries we conditionally pull in -->
        {{ if .Scratch.Get "needPopper" }}
            <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" defer></script>
        {{ end }}

        <div id="scroll-to-top-container" aria-hidden="true">
            <button id="scroll-to-top" title='{{ i18n "button_top"}}'>
                {{ partial "icon.html" "top" }}
            </button>
        </div>

        {{ if .Site.Data.args.preliminary }}
            <div id="switch-lang-container" aria-hidden="true">
                {{ $home := .Site.GetPage "home" }}
                <a id="switch-lang" data-skipendnotes="true" title='{{ i18n "switch_lang"}}'>
                    {{ partial "icon.html" "switch-lang" }}
                </a>
            </div>

            {{ if .Page.Params.source_repo }}
                <div id="edit-this-page-container" aria-hidden="true">
                    {{ $msg := i18n "generated_file" }}
                    {{ $title := printf $msg .Page.Params.source_repo }}

                    <a tabindex="-1" id="edit-this-page" class="disabled" title='{{ $title }}'>
                        {{ partial "icon.html" "pencil" }}
                    </a>
                </div>
            {{ else }}
                <div id="edit-this-page-container" aria-hidden="true">
                    <a tabindex="-1" id="edit-this-page" data-skipendnotes="true" href="https://github.com/istio/istio.io/edit/{{ .Site.Data.args.doc_branch_name }}/content/{{ .Lang }}/{{ .Path }}" title='{{ i18n "edit_on_github"}}'>
                        {{ partial "icon.html" "pencil" }}
                    </a>
                </div>
            {{ end }}

            <div id="report-site-bugs-container" aria-hidden="true">
                <a tabindex="-1" id="report-site-bugs" data-skipendnotes="true" href="https://github.com/istio/istio.io/issues/new?title=Issue%20with%20{{ .Path}}" aria-hidden="true" title='{{ i18n "report_site_bugs"}}'>
                    {{ partial "icon.html" "bugs" }}
                </a>
            </div>
        {{ end }}
    </body>
</html>
